import './main.scss'
import clockHtml from '@/pages/demo/components/clock/clock.html'
import executeClock from '@/pages/demo/components/clock/clock.js'
export default function () {
    // 获取日期字符串
    function getDateStr() {
        const now = new Date()
        let _year = now.getFullYear()
        let _month = now.getMonth() + 1
        let _day = now.getDate()
        let _week = now.getDay()
        let weekEnum = {
            0: '日',
            1: '一',
            2: '二',
            3: '三',
            4: '四',
            5: '五',
            6: '六'
        }

        return `${_year}年${_month > 9 ? _month : '0' + _month}月${_day > 9 ? _day : '0' + _day}日 星期${weekEnum[_week]}`
    }
    let El_mainContainer = $('.main-container')
    let El_clockBox = El_mainContainer.find('.clock-box')
    let El_dateText = El_mainContainer.find('.date-text')
    El_clockBox.append(clockHtml)
    executeClock('#DCDCDC', '#666', '#fff')
    El_dateText.text(getDateStr())
}
